home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / RotateBlur.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-01-18  |  2.5 KB  |  109 lines

  1. /*******************************/
  2. /* Rotate Blur V2.0            */
  3. /* Image Engineer Macro script */
  4. /* by Simon Edwards            */
  5. /* 16/1 97                     */
  6. /*                             */
  7. /* This creates a sort of spin */
  8. /* motion blur effect.         */
  9. /*******************************/
  10.  
  11. Options results
  12. signal on error         /* Setup a place for errors to go */
  13.  
  14. if arg()==0 then exit
  15.  
  16. PROJECT_INFO arg(1) WIDTH
  17. sourcewidth=RESULT
  18. PROJECT_INFO arg(1) HEIGHT
  19. sourceheight=RESULT
  20.  
  21. 'FORM "Rotate Blur" "Ok|Cancel"',
  22. ' TEXT,"Creates a rotating blur effect."',
  23. ' CYCLE,"Method:","Mix (blurring)|Max (brighten)|Min (darken)",0',
  24. ' CYCLE,"Degrees:","1|2|4|8|16",2',
  25. ' CYCLE,"Step:","1|0.5|0.25|0.125",1'
  26.          
  27. parse var result ok Method times degrees
  28. if ok = 0 then exit
  29.  
  30. select
  31.     when degrees=0 then degrees=1
  32.     when degrees=1 then do
  33.         degrees=0.5
  34.         times=times+1
  35.         end
  36.     when degrees=2 then do
  37.         degrees=0.25
  38.         times=times+2
  39.         end
  40.     when degrees=3 then do
  41.         degrees=0.125
  42.         times=times+3
  43.         end
  44. end
  45.  
  46. select
  47.     when Method=0 then Method="MIX 50"
  48.     when Method=1 then Method="MAX"
  49.     when Method=2 then Method="MIN"
  50. end
  51.  
  52. ROTATE arg(1) degrees BEST
  53. temp=RESULT
  54.  
  55. PROJECT_INFO temp WIDTH
  56. tempwidth=RESULT
  57. PROJECT_INFO temp HEIGHT
  58. tempheight=RESULT
  59.  
  60. MARK temp PRIMARY
  61. MARK arg(1) SECONDARY
  62. COMPOSITE (sourcewidth-tempwidth)/2 (sourceheight-tempheight)/2 method
  63. temp2=RESULT
  64. CLOSE temp
  65.  
  66. degrees=degrees*2
  67.  
  68. do while times~=0
  69.  
  70.     ROTATE temp2 degrees BEST
  71.     temp=RESULT
  72.     
  73.     PROJECT_INFO temp WIDTH
  74.     tempwidth=RESULT
  75.     PROJECT_INFO temp HEIGHT
  76.     tempheight=RESULT
  77.     
  78.     MARK temp PRIMARY
  79.     MARK temp2 SECONDARY
  80.     COMPOSITE (sourcewidth-tempwidth)/2 (sourceheight-tempheight)/2 method
  81.     temp3=RESULT
  82.     CLOSE temp2
  83.     CLOSE temp
  84.  
  85.     temp2=temp3
  86.     degrees=degrees*2
  87.     times=times-1
  88. end
  89.  
  90. exit
  91.  
  92. /*******************************************************************/
  93. /* This is where control goes when an error code is returned by IE */
  94. /* It puts up a message saying what happened and on which line     */
  95. /*******************************************************************/
  96. error:
  97. if RC=5 then do         /* Did the user just cancel us? */
  98.     IE_TO_FRONT
  99.     LAST_ERROR
  100.     'REQUEST "'||RESULT||'"'
  101.     exit
  102. end
  103. else do
  104.     IE_TO_FRONT
  105.     LAST_ERROR
  106.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  107.     exit
  108. end
  109.